# To change this template, choose Tools | Templates
# and open the template in the editor.

from game.gui.label import MultiLabel

class EquipmentManager:
    def __init__(self, rect):
        self.sep = "<br>"
        self.widget = MultiLabel(rect=rect, padding=(0,20,0,0), align=1)

    def set(self, equ):
        self.equipment = equ

    def rebuild(self):

        data = []
        for k,v in self.equipment.items():
            for s,i in v.items():
                data.append(s + ": " + ("<empty>" if i is None else i.name))

        out = self.sep.join(data)

        self.widget.set_text(out)